# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=delfin
pkgver=0.4.4
pkgrel=0
pkgdesc="Stream movies and TV shows from Jellyfin"
url="https://delfin.avery.cafe/"
arch="all !x86" # x86: fails to build
license="GPL-3.0-only"
depends="
	gtk4.0
	libadwaita
	mpv
	"
makedepends="
	cargo
	cargo-auditable
	clang
	desktop-file-utils
	gtk4.0-dev
	libadwaita-dev
	meson
	mpv-dev
	"
source="delfin-$pkgver.tar.gz::https://codeberg.org/avery42/delfin/archive/v$pkgver.tar.gz
	cargo-auditable.patch
	"
builddir="$srcdir/$pkgname"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	abuild-meson . output -Dprofile=release
	meson compile -C output
}

check() {
	meson test --no-rebuild -C output
}

package() {
	cd "$builddir/output"
	meson install --no-rebuild --destdir "$pkgdir"
}

sha512sums="
6b48321bca2de86e74c3fcbb0fd072c1cdbc1d3ad9b59d323381b93ae4b3254c6c103e622e9b2452fa72a3e2ee38a0e9db00efef304f8eb201e254b82d90b2b2  delfin-0.4.4.tar.gz
2b3f51bf47e847a959545844c37921c612b4b91387f94ad6b1a146be2ce81615274ea6f245eb6b08f21c2d506a7af1f4bfd358feddeacf3623b08e087292fe63  cargo-auditable.patch
"
